<template>
	<view>
		<view class="list">
			<view class="item" v-for="(item,index) in list">
				<!-- 横向 -->
				<view class="transverse" v-if="item.types==1">
					<image class="img" @click="clickImg(index,item)" :src="item.cover_url" mode=""></image>
					<image class="img1" @click="clickImg(index,item)" :src="item.cover_url" mode=""
						style="width: 350rpx;height: 173rpx;"></image>
				</view>
				<!-- 纵向 -->
				<view class="direction" v-else>
					<image class="img" @click="clickImg(index,item)" :src="item.cover_url" mode=""></image>
				</view>

				<view class="name" @click="clickImg(index,item)">
					<view class="text">
						{{item.video_name}}
					</view>
				</view>
				<view class="masks" @click="clickImg(index,item)">
					<view class="tz">
						立即制作
						<image class="right" src="https://tb.wuyouzhuan888.com/applet-icon/l3.png" alt="">
					</view>

				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				default: []
			},
		},
		data() {
			return {
			}
		},
		methods: {
			clickImg(index, item) {
				uni.removeStorageSync('videoId')
				uni.removeStorageSync('videoName')
				uni.setStorageSync('videoId', item.id)
				uni.setStorageSync('videoName', item.video_name)
				// 获取推荐图片数组
				uni.navigateTo({
					url: "/pages/sys/video_bags/videoProduction?videoId=" + item.id
				})
			},
		}


	}
</script>

<style lang="scss" scoped>
	.list {
		display: flex;
		flex-wrap: wrap;

		.item {
			margin: 24rpx;
			width: 44%;
			height: 520rpx;
			position: relative;
			overflow: hidden;
			border-radius: 20rpx;

			&:nth-child(2n) {
				margin-right: 0;
			}

			.transverse {
				.img {
					width: 350rpx;
					height: 520rpx;
					border-radius: 20rpx;
					filter: blur(25rpx);
				}
			}

			.direction {
				.img {
					width: 350rpx;
					height: 520rpx;
					border-radius: 20rpx;
					// filter: blur(25rpx);
				}
			}

			.img1 {
				position: absolute;
				top: 50%;
				transform: translateY(-50%);
			}
			.name {
				position: absolute;
				top: 20rpx;
				left: 0;
				height: 44rpx;
				background-color: rgba(0, 0, 0, 0.45);
				border-radius: 0 30rpx 30rpx 0;
				padding: 0 15rpx;
				.text {
					color: #FFFFFF;
					line-height: 44rpx;
					text-align: center;
					font-family: PingFang HK-Light;
				}
			}
		}
		.masks {
			position: absolute;
			bottom: 0;
			right: 0rpx;
			width: 180rpx;
			height: 45rpx;
			background-image: url('https://tb.wuyouzhuan888.com/applet-icon/ae2833b9e393aa9a2f659bb1a3e93e80.png');
			background-size: 100%;
			.tz {
				font-size: 24rpx;
				color: #FFFFFF;
				position: absolute;
				display: flex;
				justify-content: center;
				align-items: center;
				bottom: 10rpx;
				left: 30rpx;
				line-height: 100%;
			}
			.right {
				bottom: 11rpx;
				width: 14rpx;
				height: 20rpx;
				margin-left: 18rpx;
			}
		}
	}
</style>